//4.  编写一个程序实现文件拷贝的功能
#include<stdio.h>
int main(int argc,char **argv)
{
	if(argc < 3)
	{
		printf("notice: %s  源文件  目标文件\n",argv[0]);
		return -1;
	}
	FILE *fp;
	FILE *fp2;
	if((fp = fopen(argv[1], "r")) == NULL)
	{
		printf("打开file1失败！\n");
		return -1;
	}
	if((fp2 = fopen(argv[2], "w")) == NULL)
	{
		printf("打开file2失败！\n");
		return -1;
	}
	char ch;
	ch = fgetc(fp);
	while(ch != EOF)
	{
		fputc(ch,fp2);
		ch = fgetc(fp);
	}
	fclose(fp);
	fclose(fp2);
	return 0;
}
